/* 发布页面样式 */
.publish-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.publish-container h2 {
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

.publish-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-color);
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--link-color);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

/* 预览部分 */
.preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.preview-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.content-preview {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    min-height: 200px;
}

.preview-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-image {
    width: 100%;
    height: 300px;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--hover-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-image.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 0.9rem;
    opacity: 0.6;
}

.preview-image.empty::after {
    content: '暂无图片';
}

.preview-content {
    margin: 1.5rem 0;
    color: var(--text-color);
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 1rem;
    min-height: 100px;
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.preview-tag {
    padding: 0.4rem 1rem;
    background: var(--hover-color);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.preview-tag:hover {
    transform: translateY(-2px);
    background: var(--border-color);
}

/* 空状态提示 */
.content-preview:empty::after {
    content: '预览内容将显示在这里';
    color: var(--text-color);
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    font-size: 0.9rem;
}

/* 按钮样式 */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.preview-btn,
.publish-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.preview-btn {
    background: var(--hover-color);
    color: var(--text-color);
    flex: 1;
}

.publish-btn {
    background: var(--link-color);
    color: white;
    flex: 1;
}

.preview-btn:hover {
    background: var(--border-color);
}

.publish-btn:hover {
    background: #2980b9;
}

/* 错误提示 */
.form-group .error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .publish-container {
        margin: 1rem;
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .preview-btn,
    .publish-btn {
        width: 100%;
    }
}

/* 加载动画 */
.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--link-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 发布成功提示 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background: #2ecc71;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,20%);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
} 

/* 空状态样式 */
.empty {
    color: var(--text-color) !important;
    opacity: 0.5;
    font-style: italic;
}

/* 自动保存消息 */
.autosave-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.8rem 1.5rem;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 5px;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

/* 错误消息 */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background: #e74c3c;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,20%);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.error-icon {
    font-style: normal;
}

/* 成功消息 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background: #2ecc71;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,20%);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.success-icon {
    font-style: normal;
}

/* 预览内容的补充样式 */
.preview-content {
    font-family: 'Microsoft YaHei', sans-serif;
}

.preview-content br {
    margin-bottom: 0.5rem;
}

.preview-tag.empty {
    background: transparent;
    border: 2px dashed var(--border-color);
}

/* 加载状态 */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .preview-title {
        font-size: 1.5rem;
    }

    .preview-image {
        height: 200px;
    }

    .preview-content {
        font-size: 0.95rem;
    }

    .preview-tag {
        font-size: 0.85rem;
    }
} 